import {cateList} from '../../../request/api'

const state={
    catelist:[]
}

const getters={
    getCateList(state){
        return  state.catelist
    }
}

const mutations={
    REQ_CATELIST(state,payload){
        state.catelist=payload
    }
}

const  actions={
    // 获取列表
    getCateListAction({commit}){
        cateList({
            istree:1
        }).then(res=>{
            // console.log(res)
            if(res.code==200){
                commit('REQ_CATELIST',res.list)
            }
        })
    }
}

export default{
    state,
    getters,
    mutations,
    actions,
    namespaced:true
}